<?php

namespace app\service;

use app\model\BindingDeviceModel;

class BindingDeviceService
{

    public static function getAllByUser($uid)
    {
        $data = BindingDeviceModel::all(['user_id' => $uid]);
        return BindingDeviceModel::formatCollectionData($data);
    }

    public static function deleteByUser($uid)
    {
        // TODO 改为软删除  更新缓存
        return BindingDeviceModel::destroy(['uid' => $uid]);
    }
}
